/* TOTP生成器样式 - 现代化设计 */
.totp-generator {
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: linear-gradient(160deg, #f9faff 0%, #eef2ff 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  .header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    padding-top: 10px;

    .title {
      font-size: 28px;
      font-weight: 700;
      color: #111827;
      margin: 16px 0 8px;
      text-align: center;
    }

    .description {
      font-size: 24px;
      color: #6b7280;
      text-align: center;
    }
  }

  .timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;

    .timer-circle {
      width: 110px;
      height: 110px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      box-shadow: 0 15px 30px -5px rgba(67, 56, 202, 0.15);
      background: conic-gradient(#4338ca var(--progress, 100%), #e4e4fc 0);
      transition: --progress 1s linear;

      &::before {
        content: '';
        position: absolute;
        width: 90%;
        height: 90%;
        border-radius: 50%;
        background: #ffffff;
        box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
      }

      .timer-text {
        position: relative;
        font-size: 36px;
        font-weight: 700;
        color: #4338ca;
        font-variant-numeric: tabular-nums;
      }

      &.loading-circle {
        animation: spin 2s infinite linear;
        background: conic-gradient(#4338ca 50%, #e4e4fc 50%);

        .timer-text {
          animation: pulse 1.5s infinite ease-in-out;
        }
      }
    }
  }

  // 加载状态的动画效果
  @keyframes pulse {
    0% {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
    100% {
      opacity: 1;
    }
  }

  .accounts-container {
    flex: 1;
    margin-bottom: 20px;

    .empty-state {
      background: #ffffff;
      border-radius: 16px;
      padding: 32px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.03);
      margin: 0 4px;

      .empty-text {
        font-size: 26px;
        font-weight: 600;
        color: #111827;
        margin-bottom: 12px;
      }

      .empty-desc {
        font-size: 24px;
        color: #6b7280;
      }
    }

    .accounts-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
      padding: 0 4px;

      .account-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #ffffff;
        border-radius: 16px;
        padding: 18px 22px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
        transition: all 0.2s ease;

        &:active {
          transform: scale(0.98);
          background: #f9f7ff;
        }

        .account-info {
          display: flex;
          flex-direction: column;

          .account-name {
            font-size: 26px;
            font-weight: 600;
            color: #111827;
            margin-bottom: 6px;
          }

          .account-issuer {
            font-size: 24px;
            color: #6b7280;
          }
        }

        .account-code {
          font-family: 'SF Mono', 'Roboto Mono', 'Courier New', monospace;
          font-size: 30px;
          font-weight: 700;
          color: #4338ca;
          letter-spacing: 1.5px;
          font-variant-numeric: tabular-nums;
          display: block;
          margin: 5px 0;
          background-color: rgba(233, 238, 255, 0.5);
          padding: 6px 12px;
          border-radius: 8px;
          text-align: center;
        }

        .loading-code {
          font-size: 24px;
          color: #6b7280;
          font-style: italic;
          animation: pulse 1.5s infinite ease-in-out;
        }
      }
    }
  }

  .action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 4px;

    .action-btn {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      height: 64px;
      border-radius: 16px;
      border: none;
      font-size: 24px;
      font-weight: 600;
      transition: all 0.2s ease;

      &:active {
        transform: translateY(2px);
      }
    }

    .add-btn {
      background: linear-gradient(135deg, #4338ca, #6366f1);
      color: white;
      box-shadow: 0 12px 20px -5px rgba(67, 56, 202, 0.25);
    }

    .scan-btn {
      background: #ffffff;
      color: #4338ca;
      border: 1px solid #e5e7eb;
      box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    }

    .refresh-button {
      width: 64px;
      height: 64px;
      border-radius: 16px;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
      border: 1px solid #e5e7eb;
      transition: all 0.2s ease;

      .refresh-icon {
        font-size: 32px;
        color: #4338ca;
        transition: transform 0.5s ease;
        display: block;

        &.refreshing {
          animation: spin 1s linear infinite;
        }
      }

      &:active {
        transform: scale(0.95);
      }
    }
  }

  .clear-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: white;
    box-shadow: 0 12px 20px -5px rgba(239, 68, 68, 0.25);
    margin-top: 10px;
    height: 64px;
    border-radius: 16px;
    font-weight: 600;
    transition: all 0.2s ease;

    &:active {
      transform: translateY(2px);
    }
  }

  /* Dialog样式 */
  :global {
    .taroify-dialog {
      border-radius: 20px;
      overflow: hidden;
      box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

      &__header {
        font-weight: 700;
        color: #111827;
        padding: 24px 28px 16px;
        font-size: 28px;
      }

      .taroify-cell-group {
        background: #ffffff;
        --cell-group-inset-padding: 16px;

        &--inset {
          margin: 16px;
          border-radius: 16px;
          overflow: hidden;
          box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        }
      }

      .taroify-cell {
        padding: 16px 18px;

        &__title {
          font-size: 24px;
          color: #4b5563;
          font-weight: 500;
        }
      }

      .dialog-input {
        text-align: right;
        font-size: 24px;
        padding: 8px 12px;
        background-color: #f9fafb;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
      }

      &__footer {
        padding: 20px;

        button {
          border-radius: 14px;
          font-weight: 600;
          height: 60px;
          font-size: 24px;
          display: flex;
          align-items: center;
          justify-content: center;

          &:first-child {
            color: #4b5563;
            background-color: #f9fafb;
            border: 1px solid #e5e7eb;
          }

          &:last-child {
            background: linear-gradient(135deg, #4338ca, #6366f1);
            color: white;
          }
        }
      }
    }

    /* SwipeCell样式 */
    .taroify-swipe-cell {
      border-radius: 16px;
      overflow: hidden;
      margin-bottom: 1px;

      .swipe-actions {
        height: 100%;
        display: flex;

        button {
          height: 100%;
          border: none;
          width: 80px;
          display: flex;
          align-items: center;
          justify-content: center;

          &.edit-action {
            background: linear-gradient(135deg, #4338ca, #6366f1);
            color: white;
          }

          &.delete-action {
            background: linear-gradient(135deg, #dc2626, #ef4444);
            color: white;
          }
        }
      }
    }

    /* Toast样式 */
    .taroify-toast {
      max-width: 75%;
      border-radius: 16px;
      background: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(8px);

      &--text {
        padding: 14px 18px;
        font-size: 24px;
        color: white;
      }

      &--success {
        background: rgba(22, 101, 52, 0.9);
      }

      &--error {
        background: rgba(185, 28, 28, 0.9);
      }
    }
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-text {
  background-color: white;
  padding: 16px 24px;
  border-radius: 8px;
  color: #333;
  font-size: 16px;
}
.btn-flex {
  display: flex;
  align-items: center;
  justify-content: center;
}

